package main

import (
	"context"
	"fmt"
	"github.com/jackc/pgx/v4/pgxpool"
	"os"
)

func main() {
	dbAddr := "postgres://postgres:13801098189@localhost:5432/macfamilytree"
	dbPool, err := pgxpool.Connect(context.Background(), dbAddr)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err)
		os.Exit(1)
	} else {
		fmt.Println("Connected")
	}
	defer dbPool.Close()


    //query := "select * from company;"
	//
	//var queryResult string
	//err = dbPool.QueryRow(context.Background(), query).Scan(&queryResult)
	//if err != nil {
	//	fmt.Fprintf(os.Stderr, "QueryRow failed: %v\n", err)
	//	os.Exit(1)
	//} else {
	//	fmt.Println(queryResult)
	//}
	//
	//fmt.Println("finished")


}